package com.ymatou.query.seller.trading.api.testcase;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.json.JSONArray;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.query.seller.trading.api.parameter.GetOrderListByOrderIdListBean;
import com.ymatou.query.seller.trading.api.parameter.OrderEntities;
import com.ymatou.query.seller.trading.api.parameter.OrderInfo;
import com.ymatou.query.seller.trading.api.parameter.Ymt_O_OrderNote;
import com.ymatou.query.seller.trading.api.parameter.Ymt_Order;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderInfo;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderState;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderSummary;
import com.ymatou.query.seller.trading.api.parameter.resp.GetOrderListByOrderIdListResponse;
import com.ymatou.query.seller.trading.api.parameter.sp.Sp_GetOrderListByOrderIdList;
import com.ymatou.query.seller.trading.api.service.GetOrderListByOrderIdListCall;
import com.ymatou.query.trading.api.parameter.OrderConverter;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.OrderCallService;
import com.ymttest.common.entitie.OrderItemInfo;
import com.ymttest.common.entitie.OrderItemInfoExt;
import com.ymttest.database.model.ProductPromotion;
import com.ymttest.database.model.Ymt_Bill;
import com.ymttest.database.model.Ymt_CreditDetail;
import com.ymttest.database.model.Ymt_OrderExt;
import com.ymttest.database.model.Ymt_OrderPostPay;
import com.ymttest.database.model.Ymt_OrderToBill;
import com.ymttest.database.model.Ymt_Order_Frozen;
import com.ymttest.database.model.Ymt_TradingItem;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.constant.ECode;

public class Ts_GetOrderListByOrderIdList {
	private static GetOrderListByOrderIdListBean getorderlistbyorderidlistbean;
	private static GetOrderListByOrderIdListCall getorderlistbyorderidlistcall;

	protected void ConstructResponse(GetOrderListByOrderIdListResponse response) {
		Sp_GetOrderListByOrderIdList sp = new Sp_GetOrderListByOrderIdList();
		sp.setSellerId(getorderlistbyorderidlistbean.getSellerId());
		sp.setOrderIds(getorderlistbyorderidlistbean.getOrderIdList());
		sp.execute();
		OrderEntities result = ConvertResult(sp);
		response.setOrderInfoList(OrderConverter.AsOrderInfos(result, true));
	}

	@SuppressWarnings("rawtypes")
	private OrderEntities ConvertResult(Sp_GetOrderListByOrderIdList sp) {
		OrderEntities result = new OrderEntities();

		List<Ymt_Order> orders = new ArrayList<Ymt_Order>();
		if (!DataUtil.isNullOrEmpty(sp.getYmt_orders())) {
			for (Map m : sp.getYmt_orders()) {
				Ymt_Order order = new Ymt_Order();
				DataUtil.mapToBean(order, m);
				orders.add(order);
			}
		}
		result.setOrders(orders);

		List<Ymt_OrderExt> orderExts = new ArrayList<Ymt_OrderExt>();
		if (!DataUtil.isNullOrEmpty(sp.getYmt_orderext())) {
			for (Map m : sp.getYmt_orderext()) {
				Ymt_OrderExt orderExt = new Ymt_OrderExt();
				DataUtil.mapToBean(orderExt, m);
				orderExts.add(orderExt);
			}
		}
		result.setOrderExts(orderExts);

		List<Ymt_O_OrderNote> orderNotes = new ArrayList<Ymt_O_OrderNote>();
		if (!DataUtil.isNullOrEmpty(sp.getYmt_o_ordernote())) {
			for (Map m : sp.getYmt_o_ordernote()) {
				Ymt_O_OrderNote orderNote = new Ymt_O_OrderNote();
				DataUtil.mapToBean(orderNote, m);
				orderNotes.add(orderNote);
			}
		}
		result.setOrderNotes(orderNotes);

		List<Ymt_OrderState> orderStates = new ArrayList<Ymt_OrderState>();
		if (!DataUtil.isNullOrEmpty(sp.getYmt_orderstate())) {
			for (Map m : sp.getYmt_orderstate()) {
				Ymt_OrderState orderState = new Ymt_OrderState();
				DataUtil.mapToBean(orderState, m);
				orderStates.add(orderState);
			}
		}
		result.setOrderStates(orderStates);

		List<Ymt_OrderPostPay> postPays = new ArrayList<Ymt_OrderPostPay>();
		if (!DataUtil.isNullOrEmpty(sp.getYmt_orderpostpay())) {
			for (Map m : sp.getYmt_orderpostpay()) {
				Ymt_OrderPostPay postPay = new Ymt_OrderPostPay();
				DataUtil.mapToBean(postPay, m);
				postPays.add(postPay);
			}
		}
		result.setPostPays(postPays);

		List<Ymt_OrderInfo> orderInfos = new ArrayList<Ymt_OrderInfo>();
		if (!DataUtil.isNullOrEmpty(sp.getYmt_orderinfo())) {
			for (Map m : sp.getYmt_orderinfo()) {
				Ymt_OrderInfo orderInfo = new Ymt_OrderInfo();
				DataUtil.mapToBean(orderInfo, m);
				orderInfos.add(orderInfo);
			}
		}
		result.setOrderInfos(orderInfos);

		List<Ymt_OrderSummary> orderSummaries = new ArrayList<Ymt_OrderSummary>();
		if (!DataUtil.isNullOrEmpty(sp.getYmt_ordersummary())) {
			for (Map m : sp.getYmt_ordersummary()) {
				Ymt_OrderSummary orderSummarie = new Ymt_OrderSummary();
				DataUtil.mapToBean(orderSummarie, m);
				orderSummaries.add(orderSummarie);
			}
		}
		result.setOrderSummaries(orderSummaries);

		List<Ymt_Order_Frozen> orderFrozens = new ArrayList<Ymt_Order_Frozen>();
		if (!DataUtil.isNullOrEmpty(sp.getYmt_order_frozen())) {
			for (Map m : sp.getYmt_order_frozen()) {
				Ymt_Order_Frozen orderFrozen = new Ymt_Order_Frozen();
				DataUtil.mapToBean(orderFrozen, m);
				orderFrozens.add(orderFrozen);
			}
		}
		result.setOrderFrozens(orderFrozens);

		List<Ymt_OrderToBill> orderToBills = new ArrayList<Ymt_OrderToBill>();
		if (!DataUtil.isNullOrEmpty(sp.getYmt_ordertobill())) {
			for (Map m : sp.getYmt_ordertobill()) {
				Ymt_OrderToBill orderToBill = new Ymt_OrderToBill();
				DataUtil.mapToBean(orderToBill, m);
				orderToBills.add(orderToBill);
			}
		}
		result.setOrderToBills(orderToBills);

		List<Ymt_Bill> bills = new ArrayList<Ymt_Bill>();
		if (!DataUtil.isNullOrEmpty(sp.getYmt_bill())) {
			for (Map m : sp.getYmt_bill()) {
				Ymt_Bill bill = new Ymt_Bill();
				DataUtil.mapToBean(bill, m);
				bills.add(bill);
			}
		}
		result.setBills(bills);

		List<Ymt_TradingItem> tradingItems = new ArrayList<Ymt_TradingItem>();
		Ymt_TradingItem tradingItem = new Ymt_TradingItem();
		DataUtil.mapToBean(tradingItem, sp.getOrderTradingId());
		tradingItems.add(tradingItem);
		result.setTradingItems(tradingItems);

		List<Ymt_CreditDetail> creditDetails = new ArrayList<Ymt_CreditDetail>();
		result.setCreditDetails(creditDetails);
		return result;
	}

	private void verify() {
		GetOrderListByOrderIdListResponse expectResponse = new GetOrderListByOrderIdListResponse();
		ConstructResponse(expectResponse);
		GetOrderListByOrderIdListResponse actualResponse = getorderlistbyorderidlistcall
				.getOrderListByOrderIdListResponse();
		if (expectResponse.getOrderInfoList() == null) {
			DataUtil.verifyEquals(null, actualResponse.getOrderInfoList(),
					"验证OrderInfoList==null");
		} else {
			DataUtil.verifyEquals(expectResponse.getOrderInfoList().size(),
					actualResponse.getOrderInfoList().size(),
					"验证OrderInfoList.size()");
			boolean equalSize = expectResponse.getOrderInfoList().size() == actualResponse
					.getOrderInfoList().size();
			if (equalSize) {
				for (int i = 0; i < expectResponse.getOrderInfoList().size(); i++) {
					OrderInfo expect = expectResponse.getOrderInfoList().get(i);
					OrderInfo actual = actualResponse.getOrderInfoList().get(i);
					DataUtil.verifyDateEquals(expect.getAcceptTime(),
							actual.getAcceptTime(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的AcceptTime");
					DataUtil.verifyDateEquals(expect.getAddress(),
							actual.getAddress(),
							"验证orderid=[" + expect.getOrderId() + "]的Address");
					DataUtil.verifyDateEquals(expect.getAddTime(),
							actual.getAddTime(),
							"验证orderid=[" + expect.getOrderId() + "]的AddTime");
					DataUtil.verifyDateEquals(expect.getApplyPostPayTime(),
							actual.getApplyPostPayTime(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的ApplyPostPayTime");
					DataUtil.verify(expect.getAutoCancelOrderHours(),
							actual.getAutoCancelOrderHours(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的AutoCancelOrderHours");
					DataUtil.verifyDateEquals(expect.getAutoReceiveTime(),
							actual.getAutoReceiveTime(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的AutoReceiveTime");
					DataUtil.verify(expect.getBillCodeList(),
							actual.getBillCodeList(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的BillCodeList");
					DataUtil.verify(expect.getBillInfoList(),
							actual.getBillInfoList(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的BillInfoList");
					DataUtil.verify(expect.getBusynessTypeList(),
							actual.getBusynessTypeList(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的BusynessTypeList");
					DataUtil.verify(expect.getBuyerId(), actual.getBuyerId(),
							"验证BuyerId");
					DataUtil.verify(expect.getBuyerLoginEmail(),
							actual.getBuyerLoginEmail(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的BuyerLoginEmail");
					DataUtil.verify(expect.getBuyerLoginId(),
							actual.getBuyerLoginId(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的BuyerLoginId");
					DataUtil.verify(expect.getBuyerNickName(),
							actual.getBuyerNickName(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的BuyerNickName");
					DataUtil.verify(expect.getCancelReason(),
							actual.getCancelReason(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的CancelReason");
					DataUtil.verifyDateEquals(expect.getCancelTime(),
							actual.getCancelTime(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的CancelTime");
					DataUtil.verifyDateEquals(expect.getChangeAddressTime(),
							actual.getChangeAddressTime(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的ChangeAddressTime");
					DataUtil.verifyDateEquals(expect.getConfirmedTime(),
							actual.getConfirmedTime(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的ConfirmedTime");
					DataUtil.verify(expect.getCouponCode(),
							actual.getCouponCode(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的CouponCode");
					DataUtil.verify(expect.getCouponType(),
							actual.getCouponType(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的CouponType");
					DataUtil.verify(expect.getCouponValue(),
							actual.getCouponValue(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的CouponValue");
					DataUtil.verifyDateEquals(expect.getCreditAddTime(),
							actual.getCreditAddTime(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的CreditAddTime");
					DataUtil.verify(expect.getCreditDescript(),
							actual.getCreditDescript(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的CreditDescript");
					DataUtil.verify(expect.getCreditId(), actual.getCreditId(),
							"验证orderid=[" + expect.getOrderId() + "]的CreditId");
					DataUtil.verify(expect.getCreditSellerReply(),
							actual.getCreditSellerReply(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的CreditSellerReply");
					DataUtil.verifyDateEquals(
							expect.getCreditSellerReplyUpdateTime(),
							actual.getCreditSellerReplyUpdateTime(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的CreditSellerReplyUpdateTime");
					DataUtil.verify(expect.getCreditServiceRange(),
							actual.getCreditServiceRange(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的CreditServiceRange");
					DataUtil.verify(expect.getCreditUniformityRange(),
							actual.getCreditUniformityRange(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的CreditUniformityRange");
					DataUtil.verifyDateEquals(expect.getCreditUpdateTime(),
							actual.getCreditUpdateTime(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的CreditUpdateTime");
					DataUtil.verify(expect.getCreditUserId(),
							actual.getCreditUserId(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的CreditUserId");
					DataUtil.verifyDateEquals(expect.getDelayReceiveAddTime(),
							actual.getDelayReceiveAddTime(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的DelayReceiveAddTime");
					DataUtil.verifyDateEquals(
							expect.getDelayReceiveFrozenTime(),
							actual.getDelayReceiveFrozenTime(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的DelayReceiveFrozenTime");
					DataUtil.verifyDateEquals(
							expect.getDelayReceiveUpdateTime(),
							actual.getDelayReceiveUpdateTime(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的DelayReceiveUpdateTime");
					DataUtil.verify(expect.getDelayReceiveUserId(),
							actual.getDelayReceiveUserId(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的DelayReceiveUserId");
					DataUtil.verify(expect.getDiscount(), actual.getDiscount(),
							"验证orderid=[" + expect.getOrderId() + "]的Discount");
					DataUtil.verifyDateEquals(expect.getDiscountTime(),
							actual.getDiscountTime(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的DiscountTime");
					DataUtil.verifyDateEquals(expect.getDispatchTime(),
							actual.getDispatchTime(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的DispatchTime");
					DataUtil.verify(expect.getDistributor(),
							actual.getDistributor(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的Distributor");
					DataUtil.verify(expect.getEmail(), actual.getEmail(),
							"验证orderid=[" + expect.getOrderId() + "]的Email");
					DataUtil.verify(expect.getFirstPay(), actual.getFirstPay(),
							"验证orderid=[" + expect.getOrderId() + "]的FirstPay");
					DataUtil.verify(expect.getFreight(), actual.getFreight(),
							"验证orderid=[" + expect.getOrderId() + "]的Freight");
					DataUtil.verify(expect.getIsMerchant(),
							actual.getIsMerchant(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的IsMerchant");
					DataUtil.verify(DataUtil.Booleann.GetValueOrDefault(expect
							.getIsNewCustomerOrder()), actual
							.getIsNewCustomerOrder(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的IsNewCustomerOrder");
					DataUtil.verify(DataUtil.Booleann.GetValueOrDefault(expect
							.getIsNewSellerOrder()), actual
							.getIsNewSellerOrder(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的IsNewSellerOrder");
					DataUtil.verify(expect.getLeaveWord(),
							actual.getLeaveWord(),
							"验证orderid=[" + expect.getOrderId() + "]的LeaveWord");
					DataUtil.verifyDateEquals(expect.getLocalRefundApplyTime(),
							actual.getLocalRefundApplyTime(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的LocalRefundApplyTime");
					DataUtil.verify(expect.getLogisticsType(),
							actual.getLogisticsType(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的LogisticsType");
					DataUtil.verify(expect.getMainOrderId(),
							actual.getMainOrderId(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的MainOrderId");
					DataUtil.verify(expect.getNeedPostPay(),
							actual.getNeedPostPay(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的NeedPostPay");
					DataUtil.verify(expect.getNeedPrePayAmountOfCash(),
							actual.getNeedPrePayAmountOfCash(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的NeedPrePayAmountOfCash");
					DataUtil.verify(expect.getOldDiscount(),
							actual.getOldDiscount(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的OldDiscount");
					DataUtil.verify(expect.getOldFreight(),
							actual.getOldFreight(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的OldFreight");
					DataUtil.verify(expect.getOperate(), actual.getOperate(),
							"验证orderid=[" + expect.getOrderId() + "]的Operate");
					DataUtil.verifyDateEquals(expect.getOperateExpireTime(),
							actual.getOperateExpireTime(), "验证orderid=["
									+ expect.getOrderId()
									+ "]的OperateExpireTime");
					DataUtil.verify(expect.getOrderDiscount(),
							actual.getOrderDiscount(),
							"验证orderid=[" + expect.getOrderId()
									+ "]的OrderDiscount");
					DataUtil.verify(expect.getOrderId(), actual.getOrderId(),
							"验证orderid=[" + expect.getOrderId() + "]的OrderId");
					if (expect.getOrderItemList() == null) {
						DataUtil.verify(null, actual.getOrderItemList(),
								"验证orderid=[" + expect.getOrderId()
										+ "]的OrderItemList==null");
					} else {
						DataUtil.verify(expect.getOrderItemList().size(),
								actual.getOrderItemList().size(), "验证orderid=["
										+ expect.getOrderId()
										+ "]的OrderItemList.size()");
						boolean goon = expect.getOrderItemList().size() == actual
								.getOrderItemList().size() ? true : false;
						if (goon) {
							for (int j = 0; j < expect.getOrderItemList()
									.size(); j++) {
								OrderItemInfo expectOrderItem = expect
										.getOrderItemList().get(j);
								OrderItemInfo actualOrderItem = actual
										.getOrderItemList().get(j);
							}
						}
					}
				}
			}
		}

	}

	private void verifyOrderItem(OrderItemInfo expect, OrderItemInfo actual,
			int orderid) {
		String expId = expect.getOrderItemId();
		String actId = actual.getOrderItemId();
		DataUtil.verify(expId, actId, "验证orderid=[" + orderid + "]的OrderItemId");
		boolean goon = expId.equals(actId) ? true : false;
		if (goon) {
			DataUtil.verify(expect.getAmount(), actual.getAmount(),
					"验证OrderItemId=[" + expId + "]的Amount");
			DataUtil.verify(expect.getBondedArea(), actual.getBondedArea(),
					"验证OrderItemId=[" + expId + "]的BondedArea");
			DataUtil.verify(expect.getCatalogId(), actual.getCatalogId(),
					"验证OrderItemId=[" + expId + "]的CatalogId");
			DataUtil.verify(expect.getCatalogId(), actual.getCatalogId(),
					"验证OrderItemId=[" + expId + "]的CatalogId");
			DataUtil.verify(expect.getDescription(), actual.getDescription(),
					"验证OrderItemId=[" + expId + "]的Description");
			DataUtil.verify(expect.getDiscount(), actual.getDiscount(),
					"验证OrderItemId=[" + expId + "]的Discount");
			DataUtil.verify(expect.getFreight(), actual.getFreight(),
					"验证OrderItemId=[" + expId + "]的Freight");
			DataUtil.verify(expect.getFreightFree(), actual.getFreightFree(),
					"验证OrderItemId=[" + expId + "]的FreightFree");
			DataUtil.verify(expect.getItemType(), actual.getItemType(),
					"验证OrderItemId=[" + expId + "]的ItemType");
			DataUtil.verify(expect.getLogisticsType(),
					actual.getLogisticsType(), "验证OrderItemId=[" + expId
							+ "]的LogisticsType");
			DataUtil.verify(expect.getOrderItemInfoExt(),
					actual.getOrderItemInfoExt(), "验证OrderItemId=[" + expId
							+ "]的OrderItemInfoExt");
			OrderItemInfoExt expExt = expect.getOrderItemInfoExt();
			OrderItemInfoExt actExt = actual.getOrderItemInfoExt();
			if (expExt == null) {
				DataUtil.verify(expect.getOrderItemInfoExt(),
						actual.getOrderItemInfoExt(), "验证OrderItemId=[" + expId
								+ "]的OrderItemInfoExt==null");
			} else {
				DataUtil.verify(expExt.getActivityId(), actExt.getActivityId(),
						"验证OrderItemId=[" + expId
								+ "]的OrderItemInfoExt.ActivityId");
				DataUtil.verify(expExt.getActivityTemplateId(),
						actExt.getActivityTemplateId(), "验证OrderItemId=["
								+ expId
								+ "]的OrderItemInfoExt.ActivityTemplateId");
				DataUtil.verify(expExt.getGiftAvail4Reward(),
						actExt.getGiftAvail4Reward(), "验证OrderItemId=[" + expId
								+ "]的OrderItemInfoExt.GiftAvail4Reward");
			}
			DataUtil.verify(expect.getPictureUrl(), actual.getPictureUrl(),
					"验证OrderItemId=[" + expId + "]的PictureUrl");
			DataUtil.verify(expect.getPremium(), actual.getPremium(),
					"验证OrderItemId=[" + expId + "]的Premium");
			DataUtil.verify(expect.getPrice(), actual.getPrice(),
					"验证OrderItemId=[" + expId + "]的Price");
			DataUtil.verify(expect.getPriceType(), actual.getPriceType(),
					"验证OrderItemId=[" + expId + "]的PriceType");
			DataUtil.verify(expect.getProductId(), actual.getProductId(),
					"验证OrderItemId=[" + expId + "]的ProductId");
			DataUtil.verify(expect.getProductOriginalPrice(),
					actual.getProductOriginalPrice(), "验证OrderItemId=[" + expId
							+ "]的ProductOriginalPrice");
			DataUtil.verify(expect.getProductPrice(), actual.getProductPrice(),
					"验证OrderItemId=[" + expId + "]的ProductPrice");
			DataUtil.verify(expect.getProductRefundChannel(),
					actual.getProductRefundChannel(), "验证OrderItemId=[" + expId
							+ "]的ProductRefundChannel");
			DataUtil.verify(expect.getPropertyInfo(), actual.getPropertyInfo(),
					"验证OrderItemId=[" + expId + "]的PropertyInfo");
			ProductPromotion expPro = expect.getPromotion();
			ProductPromotion actPro = actual.getPromotion();
			if (expPro == null) {
				DataUtil.verify(null, actPro, "验证OrderItemId=[" + expId
						+ "]的Promotion==null");
			} else {
				DataUtil.verify(expPro.getCondition(), actPro.getCondition(),
						"验证OrderItemId=[" + expId + "]的Promotion.Condition");
				DataUtil.verify(expPro.getContent(), actPro.getContent(),
						"验证OrderItemId=[" + expId + "]的Promotion.Content");
				DataUtil.verify(expPro.getID(), actPro.getID(),
						"验证OrderItemId=[" + expId + "]的Promotion.ID");
				DataUtil.verify(expPro.getName(), actPro.getName(),
						"验证OrderItemId=[" + expId + "]的Promotion.Name");
				DataUtil.verify(expPro.getPartialReducedAmount(),
						actPro.getPartialReducedAmount(), "验证OrderItemId=["
								+ expId + "]的Promotion.PartialReducedAmount");
				DataUtil.verify(expPro.getReducedAmount(),
						actPro.getReducedAmount(), "验证OrderItemId=[" + expId
								+ "]的Promotion.ReducedAmount");
				DataUtil.verify(expPro.getType(), actPro.getType(),
						"验证OrderItemId=[" + expId + "]的Promotion.Type");
			}
			DataUtil.verify(expect.getReferenceUrl(), actual.getReferenceUrl(),
					"验证OrderItemId=[" + expId + "]的ReferenceUrl");
			DataUtil.verify(expect.getRefundBillNo(), actual.getRefundBillNo(),
					"验证OrderItemId=[" + expId + "]的RefundBillNo");
			DataUtil.verify(expect.getSalesType(), actual.getSalesType(),
					"验证OrderItemId=[" + expId + "]的SalesType");
			DataUtil.verify(expect.getSellerCouponAmount(),
					actual.getSellerCouponAmount(), "验证OrderItemId=[" + expId
							+ "]的SellerCouponAmount");
			DataUtil.verify(expect.getSku(), actual.getSku(), "验证OrderItemId=["
					+ expId + "]的Sku");
			DataUtil.verify(expect.getStockStatus(), actual.getStockStatus(),
					"验证OrderItemId=[" + expId + "]的StockStatus");
			DataUtil.verify(expect.getSubProductCategoryId(),
					actual.getSubProductCategoryId(), "验证OrderItemId=[" + expId
							+ "]的SubProductCategoryId");
			DataUtil.verify(expect.getTariffType(), actual.getTariffType(),
					"验证OrderItemId=[" + expId + "]的TariffType");
			DataUtil.verify(expect.getTitle(), actual.getTitle(),
					"验证OrderItemId=[" + expId + "]的Title");
			DataUtil.verify(expect.getYmtCouponAmount(),
					actual.getYmtCouponAmount(), "验证OrderItemId=[" + expId
							+ "]的YmtCouponAmount");
		}
	}

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("根据订单id列表获取订单列表");
	}

	@Before
	public void caseUp() {

		getorderlistbyorderidlistbean = new GetOrderListByOrderIdListBean();
		getorderlistbyorderidlistcall = new GetOrderListByOrderIdListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getorderlistbyorderidlistcall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetOrderListByOrderIdList_001() {
		Logger.start(true, "根据订单id列表获取订单列表成功");
		try {
			// 创建订单
			ArrayList<Integer> list = new ArrayList<Integer>();
			Map info = new OrderCallService().createBatchM2cOrder(3);
			JSONArray Orderlist = (JSONArray) info.get("orderIds");
			int sellerId = (Integer) info.get("sellerId");
			for (int k = 0; k < Orderlist.length(); k++) {
				list.add(Orderlist.getInt(k));
			}

			// 参数
			getorderlistbyorderidlistbean.setOrderIdList(list);
			getorderlistbyorderidlistbean.setSellerId(sellerId);

			// 发送请求
			getorderlistbyorderidlistcall
					.setData(getorderlistbyorderidlistbean);
			getorderlistbyorderidlistcall.callService();
			Logger.verifyEquals(ECode.SUCCESS,
					getorderlistbyorderidlistcall.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

}
